<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html lang="en">
<head>
<script type="text/javascript">
	function show() {
		document.getElementById('newdetail').style.display = "block";
		InsertJSSkill.skillID.selectedIndex = 0;
	}
	function hide() {
		document.getElementById('newdetail').style.display = "none";
	}

	function Blank_TextField_Validator() {

		if (updateCompanyProfile.companyName.value == "") {
			alert("Please enter company name.");
			updateCompanyProfile.companyName.focus();
			return (false);
		}

		if (updateCompanyProfile.emailID.value == "") {
			alert("Please enter email address.");
			updateCompanyProfile.emailID.focus();
			return (false);
		}

		if (updateCompanyProfile.phoneNumber.value == "") {
			alert("Please enter phone number.");
			updateCompanyProfile.phoneNumber.focus();
			return (false);
		}

		return (true);
	}

	$(function() {
		$('.chzn-select').chosen();
		$('.chzn-select-deselect').chosen({
			allow_single_deselect : true
		});
	});

	function activePane() {
		var tabID = '${tabID}';
		if (tabID == "jobPostings") {
			document.getElementById("jobPostings").className = "tab-pane active";
			document.getElementById("profile").className = "tab-pane";
			document.getElementById("profileLink").className = "";
			document.getElementById("jobPostingsLink").className = "active";
		}
		
		if (tabID == "profile") {
			document.getElementById("profile").className = "tab-pane active";
			document.getElementById("jobPostings").className = "tab-pane";
			document.getElementById("jobPostingsLink").className = "";
			document.getElementById("profileLink").className = "active";
		}
	}
</script>
<link href="UserInterface/css/bootstrap.css" rel="stylesheet"
	type="text/css" />
<script src="UserInterface/js/jquery.js"></script>
<script type="text/javascript" src="UserInterface/js/bootstrap-tab.js"></script>
<title></title>
</head>
<body onload="activePane()">
	<br />
	<div class="container">
		<div class="row">
			<div class="span12">
				<!-- login form start-->
				<!--  <div class="well">-->
				<ul class="nav nav-tabs">
					<li class="active" id="profileLink"><a href="#profile"
						data-toggle="tab">Profile</a></li>
					<li id="jobPostingsLink"><a href="#jobPostings"
						data-toggle="tab" onclick="hide()">Job Postings</a></li>
				</ul>
				<div class="tab-content">
					<!-- =================================Profile Tab Begin=========================================== -->
					<div class="tab-pane active" id="profile">
						<font size="5"><b>Basic Info</b></font>
						<s:form name="updateCompanyProfile" action="updateCompanyProfile"
							onsubmit="return Blank_TextField_Validator()">
							<table class="table">
								<tr>
									<th style="text-align: center">Name</th>
									<td style="text-align: left"><input type="text"
										name="companyName" class="input-large"
										value="<s:property value="company.companyName" />"></td>
								</tr>
								<tr>
									<th style="text-align: center">Email Address</th>
									<td style="text-align: left"><input type="text"
										name="emailID" class="input-large"
										value="<s:property value="company.emailID" />"></td>
								</tr>
								<tr>
									<th style="text-align: center">Phone Number</th>
									<td style="text-align: left"><input type="text"
										name="phoneNumber" class="input-large"
										value="<s:property value="company.phoneNumber" />"></td>
								</tr>
							</table>
							<hr>
							<button class="btn btn-medium btn-primary pull-right"
								type="submit">Save</button>
						</s:form>

					</div>
					<!-- =================================Profile Tab End=========================================== -->

					<!-- =================================Job Postings Tab Begin=========================================== -->
					<div class="tab-pane" id="jobPostings">
						<font size="5"><b>Job Postings</b></font>
						<table class="table">
							<tr>
								<th style="text-align: center">Job Code</th>
								<th style="text-align: center">Job Description</th>
								<th style="text-align: center">Qualifications</th>
								<th style="text-align: center">Skills</th>
								<th style="text-align: center">Location</th>
								<th />
							</tr>
							<s:iterator value="jobpostingList">
								<tr>
									<td style="text-align: center"><s:property value="jobCode" /></td>
									<td style="text-align: center"><s:property value="jobDesc" /></td>
									<td style="text-align: center"><s:property
											value="qualification" /></td>
									<td style="text-align: center"><s:property
											value="skillName" /></td>
									<td style="text-align: center"><s:property
											value="location" /></td>
									<td><a
										href="DeleteJobPosting?companyID=<s:property
									value="companyID" />">
											<i class="icon-trash"></i>
									</a></td>
								</tr>
							</s:iterator>
						</table>
						<hr>
						<div align="center">
							<form action="InsertJobPosting" class="form-inline"
								id="newdetail" name="InsertJSEQ"
								onsubmit="return Blank_TextField_Validator()">
								<input type="text" class="input-medium" placeholder="Job Code"
									name="jobCode"> <input type="text" class="input-medium"
									placeholder="Job Description" name="jobDescription"> <input
									type="text" class="input-medium" placeholder="Qualification"
									name="qualification">
								<s:select name="skillID" headerKey="-1"
									headerValue="Select Skill" list="skillMasterList"
									listKey="skillID" listValue="skillName" cssClass="chzn-select"
									style="width:200px" />
								<input type="text" class="input-medium" placeholder="Location"
									name="location">
								<button type="submit" class="btn btn-medium">Save</button>
							</form>
						</div>
						<button class="btn btn-small btn-primary pull-right" type="button"
							onclick="show()">Add Row</button>
					</div>
					<!-- =================================Job Postings Tab End=========================================== -->
					<div class="tab-pane" id="trainer">trainer</div>
				</div>
			</div>
		</div>
		<%
			session.setAttribute("tabID", "");
		%>
	</div>
</body>
</html>
